Make set_pte_at and set_pte_at_sync macros instead of inline functions.
authorchris@ubuntu.eng.hq.xensource.com <chris@ubuntu.eng.hq.xensource.com>
Wed, 14 Dec 2005 02:04:14 +0000 (19:04 -0700)
committerchris@ubuntu.eng.hq.xensource.com <chris@ubuntu.eng.hq.xensource.com>
Wed, 14 Dec 2005 02:04:14 +0000 (19:04 -0700)
This avoids having to include sched.h to get a definition of init_mm.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h
linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h

index 9bdf03410c7ae09b9ae4e96b095995b47270d3ba..ac5f7ace61da6c4aaf544042e30830a99ffa7178 100644 (file)
  */
 #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
 
-inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
-    {
-        set_pte(ptep, val);
-    }
-}
-
-inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
-    {
-        set_pte(ptep, val);
-       xen_invlpg(addr);
-    }
-}
+#define set_pte_at(_mm,addr,ptep,pteval) do {                          \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), 0))          \
+               set_pte((ptep), (pteval));                              \
+} while (0)
+
+#define set_pte_at_sync(_mm,addr,ptep,pteval) do {                     \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), UVMF_INVLPG)) { \
+               set_pte((ptep), (pteval));                              \
+               xen_invlpg((addr));                                     \
+       }                                                               \
+} while (0)
 
 #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
 
index fa516266ab0e1a29333bd6d56564de0731657e3f..eb77b6e02f8939580e0a1693ec2259c4f46244df 100644 (file)
@@ -69,26 +69,19 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
 # define set_pte_atomic(pteptr,pteval) set_pte(pteptr,pteval)
 #endif
 
-inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
-    {
-        set_pte(ptep, val);
-    }
-}
-
-inline static void set_pte_at_sync(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), UVMF_INVLPG ) )
-    {
-        set_pte(ptep, val);
-       xen_invlpg(addr);
-    }
-}
+#define set_pte_at(_mm,addr,ptep,pteval) do {                          \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), 0))          \
+               set_pte((ptep), (pteval));                              \
+} while (0)
+
+#define set_pte_at_sync(_mm,addr,ptep,pteval) do {                     \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), UVMF_INVLPG)) { \
+               set_pte((ptep), (pteval));                              \
+               xen_invlpg((addr));                                     \
+       }                                                               \
+} while (0)
 
 #ifdef CONFIG_XEN_SHADOW_MODE
 # define set_pmd(pmdptr,pmdval) \
index d6bdf76e00573e0b1d227ed65f76a7981425f7e4..0e00baf30e1cd9149e3a96c710f1f45f1f1c2e2e 100644 (file)
@@ -266,15 +266,11 @@ static inline unsigned long pud_bad(pud_t pud)
        return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);      
 } 
 
-inline static void set_pte_at(struct mm_struct *mm, unsigned long addr, 
-                      pte_t *ptep, pte_t val )
-{
-    if ( ((mm != current->mm) && (mm != &init_mm)) ||
-        HYPERVISOR_update_va_mapping( (addr), (val), 0 ) )
-    {
-        set_pte(ptep, val);
-    }
-}
+#define set_pte_at(_mm,addr,ptep,pteval) do {                          \
+       if (((_mm) != current->mm && (_mm) != &init_mm) ||              \
+           HYPERVISOR_update_va_mapping((addr), (pteval), 0))          \
+               set_pte((ptep), (pteval));                              \
+} while (0)
 
 #define pte_none(x)    (!(x).pte)
 #define pte_present(x) ((x).pte & (_PAGE_PRESENT | _PAGE_PROTNONE))